package server.billing;

import java.rmi.Remote;
import java.rmi.RemoteException;

import model.PriceSteps;
import model.Bill;

/**
 * Class represents the secure part of the billing server, which is only
 * accessable after a successfull login. It then provides all the functionality
 * of the billing server.
 */
public interface BillingServerSecure extends Remote {

	/**
	 * Gets all specified PriceSteps of the billing server.
	 * 
	 * @return The PriceSteps datastructure containing all specified PriceSteps
	 * @throws RemoteException
	 *             Thrown if remote call is not available.
	 */
	public PriceSteps getPriceSteps() throws RemoteException;

	/**
	 * Creates a new PriceStep.
	 * 
	 * @param startPrice
	 *            The start price of the step.
	 * @param endPrice
	 *            The end price of the step.
	 * @param fixedPrice
	 *            The fixed fee for the step.
	 * @param variablePricePercent
	 *            The variable fee for the step.
	 * @throws RemoteException
	 *             Thrown of this remote method is not availabe or if arguments
	 *             for the mehtod where invaled. Arguments must be positive and
	 *             the new step must not overlap with an existing one.
	 */
	public void createPriceStep(double startPrice, double endPrice,
			double fixedPrice, double variablePricePercent)
			throws RemoteException;

	/**
	 * Delets a existing PriceStep.
	 * 
	 * @param startPrice
	 *            The start price of the step.
	 * @param endPrice
	 *            The end price of the step.
	 * @throws RemoteException
	 *             Thrown if the remote method is not availabe or if the
	 *             arguments of the method are not valid, especially if a step
	 *             with this interval does not exist.
	 */
	public void deletePriceStep(double startPrice, double endPrice)
			throws RemoteException;

	/**
	 * Adds a bill entry to the whole Bill of auctions of a user.
	 * 
	 * @param user
	 *            The user that created the auction.
	 * @param auctionID
	 *            The id of the auction.
	 * @param price
	 *            The price that was paid for the auction.
	 * @throws RemoteException
	 *             Thrown if remote method is not available.
	 */
	void billAuction(String user, long auctionID, double price)
			throws RemoteException;

	/**
	 * Gets the bill for a specific user.
	 * 
	 * @param user
	 *            The user to get the bill from.
	 * @return The bill for this user.
	 * @throws RemoteException
	 *             Thrown if the remote method is not available.
	 */
	Bill getBill(String user) throws RemoteException;

}
